<template>
	<view>
		<!-- top -->
		<view class="top">
			<image :src="userInfo.headimg" class="top_avatar"></image>
			<view class="top_box">
				<view class="top_box_name">{{userInfo.nickname}}</view>
				<view class="top_box_mobile">
					<image src="/static/phone.png" class="top_box_mobile_img"></image>
					<view class="top_box_mobile_num">{{userInfo.mobile}}</view>
					<!-- <view class="top_box_mobile_text" @click="clickUpdata">更新</view> -->
				</view>
			</view>
			<!-- <view class="top_r">
				<image src="/static/copy.png" class="top_r_img"></image>
				<view class="top_r_text">发布</view>
			</view> -->
		</view>
		
		<block v-for="(item,index) in list" :key="index">
			<view class="box">
				<view class="box_t">
					<view class="box_t_l">本次得分：</view>
					<view class="box_t_c">{{item.total}}</view>
					<view class="box_t_l" style="margin-left: 10rpx;">分</view>
				</view>
				<view class="box_c">考试时间：{{item.ctime}}</view>
			</view>
		</block>
		
		<view class="footer" v-if="!list.length">暂无内容</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: '',
				list: []
			};
		},
		
		onShow() {
			let that = this
			
			uni.request({
				url: getApp().globalData.url + '/sys/getuser',
				method: 'POST',
				header: {
					'content-type': 'application/x-www-form-urlencoded',
					token: uni.getStorageSync('token')
				},
				success: (res) => {
					if (res.data.code == 20000) {
						that.userInfo = res.data.data
					}
				}
			})
			
			uni.request({
				url: getApp().globalData.url + '/qu/examlist',
				method: 'POST',
				header: {
					'content-type': 'application/x-www-form-urlencoded',
					token: uni.getStorageSync('token')
				},
				success(res) {
					that.list = res.data.data
				}
			})
		},
	}
</script>

<style lang="scss">
	page{
		background: #ECECEC;
	}
	// top
	.top{
		width: 750rpx;
		height: 240rpx;
		background: #03AEA5;
		overflow: hidden;
		
		&_avatar{
			float: left;
			margin-top: 60rpx;
			margin-left: 40rpx;
			width: 120rpx;
			height: 120rpx;
			border-radius: 50%;
		}
		&_box{
			float: left;
			margin-top: 70rpx;
			margin-left: 20rpx;
			overflow: hidden;
			
			&_name{
				height: 60rpx;
				font-family: Alibaba PuHuiTi;
				font-weight: 500;
				font-size: 36rpx;
				color: #FFFFFF;
				line-height: 60rpx;
			}
			&_mobile{
				height: 50rpx;
				overflow: hidden;
				
				&_img{
					float: left;
					margin-top: 7rpx;
					margin-right: 12rpx;
					width: 16rpx;
					height: 26rpx;
				}
				&_num{
					float: left;
					font-family: Alibaba PuHuiTi;
					font-weight: 400;
					font-size: 30rpx;
					color: #FFFFFF;
					line-height: 40rpx;
				}
				&_text{
					float: left;
					margin-left: 20rpx;
					width: 80rpx;
					height: 38rpx;
					border-radius: 4rpx;
					border: 1rpx solid #FFFFFF;
					text-align: center;
					font-family: Alibaba PuHuiTi;
					font-weight: 400;
					font-size: 28rpx;
					color: #FFFFFF;
					line-height: 38rpx;
				}
			}
		}
		&_r{
			float: right;
			margin-top: 70rpx;
			margin-right: 30rpx;
			width: 100rpx;
			
			&_img{
				margin-left: 50%;
				transform: translate(-50%);
				width: 40rpx;
				height: 40rpx;
			}
			&_text{
				height: 60rpx;
				font-family: Alibaba PuHuiTi;
				font-weight: 500;
				font-size: 36rpx;
				color: #FFFFFF;
				line-height: 60rpx;
				text-align: center;
			}
		}
	}
	
	.box{
		margin-top: 20rpx;
		width: 750rpx;
		height: 254rpx;
		background: #FFFFFF;
		overflow: hidden;
		
		&_t{
			margin-left: 27rpx;
			height: 126rpx;
			border-bottom: 1rpx solid #CFCFCF;
			overflow: hidden;
			
			&_l{
				float: left;
				height: 126rpx;
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 40rpx;
				color: #333333;
				line-height: 126rpx;
			}
			&_c{
				float: left;
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 68rpx;
				color: #03AEA5;
				line-height: 126rpx;
			}
		}
		&_c{
			margin-left: 27rpx;
			height: 127rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 40rpx;
			color: #333333;
			line-height: 127rpx;
		}
	}
	
	.footer{
		margin-top: 200rpx;
		text-align: center;
		height: 60rpx;
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 40rpx;
		color: #cccccc;
		line-height: 60rpx;
	}
</style>
